Crate swc_ecma_minifier

Source
Expand description

JavaScript minifier implemented in rust.

§Assumptions

Like other minification tools, swc minifier assumes some things about the input code.

  • TDZ violation does not exist.

In other words, TDZ violation will be ignored.

  • Acesssing top-level identifiers do not have side effects.

If you declare a variable on globalThis using a getter with side-effects, swc minifier will break it.

§Debugging

In debug build, if you set an environment variable SWC_CHECK to 1, the minifier will check the validity of the syntax using node --check

§Cargo features

§debug

If you enable this cargo feature and set the environment variable named SWC_RUN to 1, the minifier will validate the code using node before each step.

Modules§

Macros§

Functions§